<!-- Modal -->
<div class="modal fade " id="addVersionModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="box box-info">
            <div class="box-header with-border">
                <h3 class="box-title">评分模型</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal">
                <div class="box-body">                 
                    <div class="form-group">
                        <label for="inputEmail3versionName" class="col-sm-2 control-label">模型名称</label>
                        <div class="col-sm-7">
                            <input id="versionName" type="text" class="form-control">
                        </div>
                    </div>
                </div>
                <!-- /.box-body -->
                <div class="box-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary pull-right" onclick="saveVersion()">保存
                    </button>
                </div>
                <!-- /.box-footer -->
            </form>
        </div>
    </div>
</div>

<script>

    function saveVersion() {
    	var versionName=$("#versionName").val();
    	if (versionName == "") {
            toastr['error']("评分模型名称不能为空", '异常');
            return;
        }
        var data = {
            versionName: versionName
            
        };
        var url = "/evaluationquota/addversion";
      
        postReq(url, data, function (result) {
            if (result.success) {
                toastr['success']('操作成功', '提示');
                refreshTable('table1');
                var versionId = $("#versionIdSelect").val();
                initVersionSelect();
                $("#versionIdSelect").val(versionId);
                $("#addVersionModal").modal("hide");
            } else {
                toastr['error'](result.msg, '提示');
            }
        });
    }
</script>
